def calculate_area(length,width):
    area = length*width
    return area

    
def describe_rectangle(**dict):  # 可变长度的关键字参数
    area = calculate_area(dict["length"],dict["width"])
    print("长：",dict["length"],"宽：",dict["width"],"面积：",area)


describe_rectangle(length=10, width=5)

# 打包和解包一般用在传参的时候
def func(a, b, c):
    print(a, b, c)

# 打包：把n变量变成1个
tuple1 = 1, 'w', [1,2,3]

# 解包：把1个变量变成n个
func(*tuple1)
# 输出 1 w [1, 2, 3]


mapping = {'name': 'wangxin', 'age': 18, 'gender': 'man'}


def func2(name, age, gender):
    print(name, age, gender)

# 用一个*解包，得到的是key    
func2(*mapping)
# name age gender

# 用一个**解包，得到的是values 
func2(**mapping)
# wangxin 18 man
